<html>
<head><meta charset="utf-8"><title>fuzzy-pickles -Zself-profile · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html">fuzzy-pickles -Zself-profile</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="148722850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148722850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148722850">(Nov 28 2018 at 16:10)</a>:</h4>
<div class="codehilite"><pre><span></span>Self profiling results for fuzzy_pickles:

| Phase            | Time (ms)      | Queries        | Hits (%) |
| ---------------- | -------------- | -------------- | -------- |
| Parsing          | 46             |                |          |
| Expansion        | 587            |                |          |
| TypeChecking     | 344            | 1012824        | 97.66    |
| BorrowChecking   | 0              | 62138          | 100.00   |
| Codegen          | 931            | 396181         | 100.00   |
| Linking          | 51             | 55549          | 100.00   |
| Other            | 1094           | 3487992        | 99.62    |

Optimization level: No
Incremental: on
</pre></div>


<p>"Other" isn't super informative, and I don't have much of an idea what I can do to make things <em>better</em> from this info.</p>



<a name="148722881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148722881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148722881">(Nov 28 2018 at 16:10)</a>:</h4>
<p>Also, 0 ms for borrow checking is not too shabby</p>



<a name="148722924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148722924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148722924">(Nov 28 2018 at 16:11)</a>:</h4>
<p>that's a lot of macro expansion :)</p>



<a name="148722940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148722940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148722940">(Nov 28 2018 at 16:11)</a>:</h4>
<p>well one of our next steps is to make it more detailed <span class="user-mention" data-user-id="116155">@Jake Goulding</span> =)</p>



<a name="148722943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148722943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148722943">(Nov 28 2018 at 16:12)</a>:</h4>
<p>seems like your case would benefit</p>



<a name="148722993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148722993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148722993">(Nov 28 2018 at 16:12)</a>:</h4>
<p>You have no idea. It's the Rust AST with multiple <code>derive</code>s for every AST node.</p>



<a name="148722998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148722998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148722998">(Nov 28 2018 at 16:12)</a>:</h4>
<p>so this is from an incrmental build after touch <code>src/lib.rs</code>?</p>



<a name="148723025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723025">(Nov 28 2018 at 16:12)</a>:</h4>
<p>You know, I think we count pre-query time in <code>Other</code>.</p>



<a name="148723045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723045">(Nov 28 2018 at 16:13)</a>:</h4>
<p>Ooops, yeah, didn't copy that part. It's incremental and just a <code>touch src/lib.rs</code></p>



<a name="148723055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723055">(Nov 28 2018 at 16:13)</a>:</h4>
<p>(Not that all of that is pre-query but it would probably be worth breaking it out separately)</p>



<a name="148723069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723069">(Nov 28 2018 at 16:13)</a>:</h4>
<p>On the upshot, this 3 seconds is notably faster than it was at the start of the year.</p>



<a name="148723124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723124">(Nov 28 2018 at 16:14)</a>:</h4>
<p>it has 100% cache hit rate and still is so slow :(</p>



<a name="148723150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723150">(Nov 28 2018 at 16:14)</a>:</h4>
<p>I don't think hashing/deserialization is counted in the results either.</p>



<a name="148723376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723376">(Nov 28 2018 at 16:18)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> actually, why aren't they all 100% hit rate? nothing changed...</p>



<a name="148723449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723449">(Nov 28 2018 at 16:19)</a>:</h4>
<p>I don't know</p>



<a name="148723504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723504">(Nov 28 2018 at 16:20)</a>:</h4>
<p>can you run with <code>-Zincremental-info</code>?</p>



<a name="148723508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723508">(Nov 28 2018 at 16:20)</a>:</h4>
<p>that might give some useful information</p>



<a name="148723902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723902">(Nov 28 2018 at 16:26)</a>:</h4>
<p><a href="https://gist.github.com/shepmaster/78430d96af2f5554ce595bf886a946b7" target="_blank" title="https://gist.github.com/shepmaster/78430d96af2f5554ce595bf886a946b7">lot of output</a></p>



<a name="148723978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148723978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148723978">(Nov 28 2018 at 16:27)</a>:</h4>
<blockquote>
<p>it has 100% cache hit rate and still is so slow :(</p>
</blockquote>
<p>one thing <span class="user-mention" data-user-id="124287">@mw</span> we didn't have time to cover but I was wondering if there are ways we can dig into what is taking time for the "incremental scenarios" (e.g., this one)</p>



<a name="148724073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148724073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148724073">(Nov 28 2018 at 16:28)</a>:</h4>
<p>interesting to see </p>
<div class="codehilite"><pre><span></span>| Codegen          | 931            | 396181         | 100.00   |
</pre></div>


<p>still one full second despite 100% hit rate :) presumably <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> we're counting <em>something</em> here beyond query execution</p>



<a name="148725569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148725569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148725569">(Nov 28 2018 at 16:48)</a>:</h4>
<p>Well with ~400 thousand queries and each one being an indirect function call, hashing, and hashmap lookup I could believe that takes a second...</p>



<a name="148725748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148725748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148725748">(Nov 28 2018 at 16:50)</a>:</h4>
<p>~2.3 µs per query</p>



<a name="148726216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148726216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148726216">(Nov 28 2018 at 16:57)</a>:</h4>
<p>That seems <em>reasonable</em> to me but I don't have a great sense of computer speeds. Maybe it's quite large.</p>



<a name="148726648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148726648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148726648">(Nov 28 2018 at 17:03)</a>:</h4>
<p>1 GHz = 1 op / ns; so this is ~7K operations (take with grain of salt)</p>



<a name="148744785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148744785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148744785">(Nov 28 2018 at 21:23)</a>:</h4>
<p>This specific task is memory latency heavy I think since we're querying HashMaps so much, but I could be wrong</p>



<a name="148791536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148791536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148791536">(Nov 29 2018 at 14:55)</a>:</h4>
<p>well, it may be that this argues for structuring somerthing in codegen into bigger groups</p>



<a name="148791537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148791537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148791537">(Nov 29 2018 at 14:55)</a>:</h4>
<p>so that we don't have as many fine-grained queries to perform</p>



<a name="148791539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/fuzzy-pickles%20-Zself-profile/near/148791539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/fuzzy-pickles.20-Zself-profile.html#148791539">(Nov 29 2018 at 14:55)</a>:</h4>
<p>I could believe that</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>